<template>
  <div>
    <div class="block">
      <el-carousel :interval="3000" width="350px" type="card" height="400px">
        <el-carousel-item v-for="item in images" :key="item">
          <img :src="item.url" alt=""  style="object-fit: none;height: 400px"/>
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="div-card">
      <el-row :gutter="20">

        <el-col :span="16">
          <div class="grid-content bg-purple">
            <h1>房间类型：{{ remark }}</h1>
            <p>价格：{{ this.money }}元</p>
            <p>房间描述：{{ this.context }} </p>
            <el-button class="mar mart" size="medium" round @click="tijiao">我要入住</el-button>
          </div>
        </el-col>


      </el-row>
    </div>
  </div>
</template>
<script>
export default {
  name: "rumu",
  data() {
    return {
      images: [
        { url: require("../../assets/bj.jpg") },
        { url: require("../../assets/jd.jpg") },
        { url: require("../../assets/drj.png") },
        { url: require("../../assets/srf.png") },
      ],
      id: "",
      remark:"",
      money:"",
        context:"",
    };
  },
  props: ["id","remark","money","context"],
  mounted() {
    this.id = this.$route.query.id;
    this.remark = this.$route.query.remark;
    this.money = this.$route.query.money;
    this.context = this.$route.query.context;
  },
  methods: {
    tijiao() {
      let location = { name: "Zhufang", query: { id: this.id } };

      this.$router.push(location);
    },
  },
};
</script>
<style>
.mart {
  margin-top: 80px;
}
.mar {
  margin-top: 20px;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.div-card {
  margin-top: 10px;
  margin-left: 30%;
}
</style>